package com.example.mall.goods.api.service;


import com.example.mall.goods.api.entity.MallShoppingCartItem;
import com.example.mall.goods.api.vo.MallShoppingCartItemVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "mall-goods-core")
public interface MallShoppingCartService {

    @PostMapping("/cart/saveMallCartItem")
    String saveMallCartItem(@RequestBody MallShoppingCartItem mallShoppingCartItem);

    @PostMapping("/cart/updateMallCartItem")
    String updateMallCartItem(@RequestBody MallShoppingCartItem mallShoppingCartItem);

    @PostMapping("/cart/getMallCartItemById")
    MallShoppingCartItem getMallCartItemById(@RequestParam("mallShoppingCartItemId") Long mallShoppingCartItemId);

    @PostMapping("/cart/deleteById")
    Boolean deleteById(@RequestParam("mallShoppingCartItemId") Long mallShoppingCartItemId);

    @PostMapping("/cart/getMyShoppingCartItems")
    List<MallShoppingCartItemVO> getMyShoppingCartItems(@RequestParam("mallUserId") Long mallUserId);

    @PostMapping("/cart/selectCountByUserId")
    int selectCountByUserId(@RequestParam("mallUserId") Long mallUserId);
}
